#if !defined(AFX_OPENGLCONTROL_H__52A6B63B_01A2_449D_8691_1FF59EECAB71__INCLUDED_)
#define AFX_OPENGLCONTROL_H__52A6B63B_01A2_449D_8691_1FF59EECAB71__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "OpenGLDevice.h"
template<class T> class CTrackBall;

class CLego_3Dview;
class COpenGLControl : public CWnd
{
public:
	COpenGLControl();
public:
	void Create(CRect rect,CWnd* parent);
	virtual ~COpenGLControl();

	CLego_3Dview *m_pView;
	

protected:
	CSize GlWndSize;
	float fGLViewNear, fGLViewFar, fGLViewHeight, fGLViewWidth;
	float m_fZoom;
	void InitGL();
	OpenGLDevice openGLDevice;
	CClientDC* dc;
	CTrackBall<double>	*m_pTrackBall;

public:
	afx_msg void	OnPaint();
	afx_msg void	OnSize(UINT nType, int cx, int cy);
	afx_msg int		OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg BOOL	OnEraseBkgnd(CDC* pDC);
	afx_msg void	OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void	OnMouseMove(  UINT nFlags, CPoint point);
	afx_msg void	OnLButtonUp(  UINT nFlags, CPoint point);     
	DECLARE_MESSAGE_MAP()
	void DrawCube(float dBBoxHSize);

};

#endif // AFX_OPENGLCONTROL_H__52A6B63B_01A2_449D_8691_1FF59EECAB71__INCLUDED_
